package com.jjyu.controller;

import com.jjyu.entity.Restaurant;
import com.jjyu.service.RecommendationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/recommendations")
public class RecommendationController {

    @Autowired
    private RecommendationService recommendationService;

    @GetMapping("/nearby")
    public List<Restaurant> getNearbyRestaurants(
            @RequestParam double latitude,
            @RequestParam double longitude,
            @RequestParam double radius) {
        return recommendationService.findNearbyRestaurants(latitude, longitude, radius);
    }
}
